package 传智播客_黑马.java高级.IO流.序列化;

import java.io.Serializable;

class Person implements Serializable {
    private int age;
    private String name;

    //这行代码,解决了序列化操作时的InvalidClassException
    static final long serialVersionUID = 1L;

    public Person(String name, int age) {
        this.age = age;
        this.name = name;
    }

    @Override
    public String toString() {
        return "Person{" +
                "age=" + age +
                ", name='" + name + '\'' +
                '}';
    }
}
